package oop5;

import oop4.Pet;
import oop4.pet.Parrot;

/**
 * @author oldliu
 * @since 1.0
 */
public class ObjecTest {
    public static void main(String[] args) {
        Pet h=new Dolphin("小翠",88,77,"母");
        h.print();//一定是Dolphin重写的print
        //h.swim():子类独有的不能调用
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        Dolphin dh=(Dolphin) h;
        dh.swim();
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>");

        Parrot parrot= (Parrot) h;
        parrot.fly();
    }
}
